/*
 * Matrix.h
 *
 *  Created on: 31.10.2011
 *      Author: stoffel
 */

#ifndef MATRIX_H_
#define MATRIX_H_

typedef float mat4[16];

//PI / 180
#define kPI180   0.017453

//180 / PI
#define k180PI  57.295780

//Degree -> Radian
#define degreeToRadian(x) (x * kPI180)

//Radian -> Degree
#define radianToDegree(x) (x * k180PI)

#include <math.h>

class Matrix {
public:
	Matrix();
	virtual ~Matrix();

	mat4 matrix;

	void loadIdentity();
	void translate(float x, float y, float z);
	void scale(float scaleX, float scaleY, float scaleZ);
	void rotateX(float degrees);
	void rotateY(float degrees);
	void rotateZ(float degrees);
	void matrixMultiply(Matrix &mMatrix1, Matrix &mMatrix2, Matrix &mResult);
	void projectionMatrix(float near, float far, float angleOfView, float height, float width);
	void orthogonalProjectionMatrix(float near, float far, float left, float right, float bottom, float top);
	void transposeInvert(Matrix &mMatrix);
	void setMatrix(float matrixIn[]);
	void invert(Matrix &mMatrix);
};

#endif /* MATRIX_H_ */
